strComputer="."
set wmi=GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set disks=wmi.InstancesOf("win32_diskdrive")
Set logicalDiskSet = wmi.InstancesOf("Win32_LogicalDisk")
strReturn="["
for each d In logicalDiskSet
    strReturn=strReturn &"{""diskName"":"""&d.name &""",""freeDisk"":"""& FormatSize(d.FreeSpace) &""",""totalDisk"":""" &FormatSize(d.Size)&"""},"
next
strReturn=left(strReturn,len(strReturn)-1)&"]"
Wscript.Echo strReturn
Function FormatSize(size)
        Dim s : s = ""
        If size>1024 Then
                size=(size/1024)
                s = FormatNumber(size, 1) & " KB"
        End If
        If size>1024 Then
                size=(size/1024)
                s = FormatNumber(size, 1) & " MB"
        End If
        If size>1024 Then
                size=(size/1024)
                s = FormatNumber(size, 1) & " GB"
        End If
        FormatSize = s
End Function